package com.itheima.chapter06.polymorphic.test2;

//多态中成员访问特点

public class Test {
    public static void main(String[] args) {
        Fu f =new Zi();
        f.method();                       //Zi...method
        System.out.println(f.num);        //10
    }
}

class Fu{
    int num =10;
    public void method(){
        System.out.println("Fu...method");
    }
}

class Zi extends Fu{
    int num =20;
    public void method(){
        System.out.println("Zi...method");
    }
}